package com.ruiyian.project.road.service.impl;

import com.ruiyian.project.road.domain.Dire;
import com.ruiyian.project.road.domain.DirePoint;
import com.ruiyian.project.road.mapper.DireMapper;
import com.ruiyian.project.road.service.DireService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author chong
 * @email 673426164@qq.com
 * @create 2021/1/19
 * Desc: 道路实现层
 */
@Service
public class DireServiceImpl implements DireService {

    @Autowired
    private DireMapper direMapper;


    /**
     * 查询列表
     * @param road
     * @return
     */
    @Override
    public List<Dire> selectList(Dire road) {
        return direMapper.selectList(road);
    }
    /**
     * 根据道路id获取设备
     * @param dire
     * @return
     */
    @Override
    public List<Dire> selectListByRoadId(Dire dire) {
        return direMapper.selectListByRoadId(dire);
    }

    /**
     * 保存
     * @param road
     */
    @Override
    public void save(Dire road) {
        direMapper.save(road);
    }


    /**
     * 编辑
     * @param road
     */
    @Override
    public void edit(Dire road) {
        direMapper.edit(road);
    }
    /**
     * 删除
     * @param id
     */
    @Override
    public void delete(Long id) {
        direMapper.delete(id);
    }

    /**
     * 根据id获取对象
     * @param id
     * @return
     */
    @Override
    public Dire findOne(Long id) {
        return direMapper.findOne(id);
    }

    /**
     * 批量删除
     * @param list
     */
    @Override
    public void deleteBatch(List<Dire> list) {
        direMapper.deleteBatch(list);
    }


    @Override
    public void savePoint(DirePoint direPoint) {
        direMapper.savePoint(direPoint);
    }

    @Override
    public List<DirePoint> queryByDireId(Long direId) {
        return direMapper.queryByDireId(direId);
    }

    @Override
    public List<DirePoint> queryByRoadId(Long roadId) {
        return direMapper.queryByRoadId(roadId);
    }
}
